/*
 * @Descripttion:
 * @version:
 * @Author: kl2018
 * @Date: 2020-03-17 09:11:32
 * @LastEditors: kl2018
 * @LastEditTime: 2020-06-23 10:16:00
 */
import { observable, action } from 'mobx';
import { WeaTableNew } from 'comsMobx';
import * as API from '../../apis/reportApi';

const { TableStore } = WeaTableNew;

class CustomReportStore {
	@action getDatasCallback = () => { this.customTableStore.operates = []; };

	@observable customTableStore = new TableStore({ getDatasCallback: this.getDatasCallback });

	@observable rightMenuData = [
		{ key: 'reload', icon: <i className="icon-coms-Refresh" />, content: getLabel('354', '刷新'), onClick: () => { this.customTableStore.reloadCurrent(this.getDatasCallback); } },
	];

	@action getTableData = () => {
		API.getCustomReportList().then((res) => {
			this.customTableStore.getDatas(res.sessionkey);
		});
	};
}

export default CustomReportStore;
